set(FDT_SRC_DIR ${PROJECT_ROOT}/lib/fdt)
set(FDT_INC_DIR ${PROJECT_ROOT}/lib/fdt)

qelib_include_directories(${FDT_INC_DIR})

qelib_sources_ifdef(
    CONFIG_LIBFDT
    ${FDT_SRC_DIR}/fdt.c
    ${FDT_SRC_DIR}/fdt_addresses.c
    ${FDT_SRC_DIR}/fdt_check.c
    ${FDT_SRC_DIR}/fdt_empty_tree.c
    ${FDT_SRC_DIR}/fdt_overlay.c
    ${FDT_SRC_DIR}/fdt_ro.c
    ${FDT_SRC_DIR}/fdt_rw.c
    ${FDT_SRC_DIR}/fdt_strerror.c
    ${FDT_SRC_DIR}/fdt_sw.c
    ${FDT_SRC_DIR}/fdt_wip.c    
)

set(FDT_INSTALL_HEADERS
    ${FDT_INC_DIR}/fdt.h
    ${FDT_INC_DIR}/libfdt_env.h
    ${FDT_INC_DIR}/libfdt_internal.h
    ${FDT_INC_DIR}/libfdt.h
)

install(FILES ${FDT_INSTALL_HEADERS} DESTINATION ${QELIB_INSTALL_PATH}/include/libfdt)